import React, { Component } from 'react';
import '../Seckill/Seckill.scss'
import service from '../../api'
class Seckill extends Component {
    constructor(props){
        super(props)
        this.state ={
            seckilllist:[]
        }
    }
    // todetail(proid){
    //     this.props.history.push('/detail/'+proid)
    // }
    async componentDidMount(){
        var res = await service.pro.pro_seckilllist()
        // console.log( res.data.data)
            this.setState({seckilllist:res.data.data})
    }
    render() {
        return (
            <div className='seckill'>
                <div className="box">
                <div className="time">
                   <div className="left">
                   <span className='one'>嗨购秒杀</span>
                   <span className='two'>18点场</span>
                   <div className="shijian">
                    <div>00</div>
                    <span>:</span>
                    <div>26</div>
                    <span>:</span>
                    <div>26</div>
                   </div>
                   </div>
                   <div className="right">
                    爆款轮播秒
                   </div>
                </div>
                <div className="kill">
                      {
                        this.state.seckilllist.map((item,index)=>{
                            return (
                                <div className="tu" key={index} >
                                    <img src={item.img2} alt="" />
                                    <div className="pri">￥{item.originprice}</div>
                                </div>
                            )
                        })
                      }
                </div>
                </div>
            </div>
        );
    }
}

export default Seckill;